package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the IND_PN_PARTIC_TITU database table.
 * 
 */
@Embeddable
public class IndPnParticTituPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String codOficReg;
	private String codReg;
	private String aaTitu;
	private String nuTitu;
	private long nsAfec;
	private long nsPersNatu;
	private String codActoRgst;
	private String sistemaId;

    public IndPnParticTituPK() {
    }

	@Column(name="COD_OFIC_REG", unique=true, nullable=false, length=2)
	public String getCodOficReg() {
		return this.codOficReg;
	}
	public void setCodOficReg(String codOficReg) {
		this.codOficReg = codOficReg;
	}

	@Column(name="COD_REG", unique=true, nullable=false, length=2)
	public String getCodReg() {
		return this.codReg;
	}
	public void setCodReg(String codReg) {
		this.codReg = codReg;
	}

	@Column(name="AA_TITU", unique=true, nullable=false, length=4)
	public String getAaTitu() {
		return this.aaTitu;
	}
	public void setAaTitu(String aaTitu) {
		this.aaTitu = aaTitu;
	}

	@Column(name="NU_TITU", unique=true, nullable=false, length=8)
	public String getNuTitu() {
		return this.nuTitu;
	}
	public void setNuTitu(String nuTitu) {
		this.nuTitu = nuTitu;
	}

	@Column(name="NS_AFEC", unique=true, nullable=false)
	public long getNsAfec() {
		return this.nsAfec;
	}
	public void setNsAfec(long nsAfec) {
		this.nsAfec = nsAfec;
	}

	@Column(name="NS_PERS_NATU", unique=true, nullable=false)
	public long getNsPersNatu() {
		return this.nsPersNatu;
	}
	public void setNsPersNatu(long nsPersNatu) {
		this.nsPersNatu = nsPersNatu;
	}

	@Column(name="COD_ACTO_RGST", unique=true, nullable=false, length=5)
	public String getCodActoRgst() {
		return this.codActoRgst;
	}
	public void setCodActoRgst(String codActoRgst) {
		this.codActoRgst = codActoRgst;
	}

	@Column(name="SISTEMA_ID", unique=true, nullable=false, length=3)
	public String getSistemaId() {
		return this.sistemaId;
	}
	public void setSistemaId(String sistemaId) {
		this.sistemaId = sistemaId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof IndPnParticTituPK)) {
			return false;
		}
		IndPnParticTituPK castOther = (IndPnParticTituPK)other;
		return 
			this.codOficReg.equals(castOther.codOficReg)
			&& this.codReg.equals(castOther.codReg)
			&& this.aaTitu.equals(castOther.aaTitu)
			&& this.nuTitu.equals(castOther.nuTitu)
			&& (this.nsAfec == castOther.nsAfec)
			&& (this.nsPersNatu == castOther.nsPersNatu)
			&& this.codActoRgst.equals(castOther.codActoRgst)
			&& this.sistemaId.equals(castOther.sistemaId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.codOficReg.hashCode();
		hash = hash * prime + this.codReg.hashCode();
		hash = hash * prime + this.aaTitu.hashCode();
		hash = hash * prime + this.nuTitu.hashCode();
		hash = hash * prime + ((int) (this.nsAfec ^ (this.nsAfec >>> 32)));
		hash = hash * prime + ((int) (this.nsPersNatu ^ (this.nsPersNatu >>> 32)));
		hash = hash * prime + this.codActoRgst.hashCode();
		hash = hash * prime + this.sistemaId.hashCode();
		
		return hash;
    }
}